﻿namespace MsForgeReboot.Framework.Entities {
    #region Usings

    using System;
    using System.ComponentModel.DataAnnotations;
    using System.Web.Mvc;

    #endregion

    /// <summary>
    ///   The post.
    /// </summary>
    public abstract class Post {
        #region Public Properties

        /// <summary>
        ///   Gets or sets the id.
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        ///   Gets or sets the author.
        /// </summary>
        [UIHint("UserProfile")]
        [Display(Name = "Kreirao")]
        public virtual User Author { get; set; }

        /// <summary>
        ///   Gets or sets the body.
        /// </summary>
        [DataType(DataType.Html)]
        [Required(AllowEmptyStrings = false)]
        [AllowHtml]
        public virtual string Body { get; set; }
        
        /// <summary>
        ///   Gets or sets the published.
        /// </summary>
        [DataType(DataType.Date)]
        [Display(Name = "Publish On")]
        public DateTime Published { get; set; }

        /// <summary>
        ///   Gets or sets the title.
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        [MaxLength(200)]
        public string Title { get; set; }

        /// <summary>
        ///   Gets or sets the URL title.
        /// </summary>
        /// <value> The URL title. </value>
        /// <example>
        ///   My Blog Post = my-blog-post
        /// </example>
        [MaxLength(200)]
        [Required(AllowEmptyStrings = false)]
        public string UrlPointer { get; set; }

        #endregion
    }
}